//
//  MVSecendHeadView.m
//  testCocoPods1.0
//
//  Created by ChenJs92 on 16/11/15.
//  Copyright © 2016年 chenjs92. All rights reserved.
//

#import "MVSecendHeadView.h"
#import "MVSecendScrooViewMode.h"
@interface MVSecendHeadView()
@property (strong, nonatomic) MVSecendScrooViewMode *viewModel;
@property (strong, nonatomic) UIView *mainScrollView;
@end

@implementation MVSecendHeadView
-(instancetype)initWithViewModel:(id<MVViewModelProtocol>)viewModel{
    self.viewModel = (MVSecendScrooViewMode *)viewModel;
    return [super initWithViewModel:viewModel];
}
-(void)updateConstraints{
    WS(weakSelf)
    [self.mainScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(weakSelf);
    }];
    [super updateConstraints];
}
-(void)yd_setupViews{
    [self addSubview:self.mainScrollView];
    
    [self setNeedsUpdateConstraints];
    [self updateConstraintsIfNeeded];
}
-(void)yd_bindViewModel{
    [self addHeadImage];
}
-(void)addHeadImage{
    NSLog(@"绘制headerImage----------");
//    self.mainScrollView.contentSize = CGSizeMake(self.bounds.size.width*self.viewModel.banarList.count, <#CGFloat height#>)
//    for (int i=0; i<self.viewModel.banarList.count; i++) {
//        UIImageView *
//    }
}
-(MVSecendScrooViewMode *)viewModel{
    if (!_viewModel) {
        _viewModel = [[MVSecendScrooViewMode alloc] init];
    }
    return _viewModel;
}
-(UIView *)mainScrollView{
    if (!_mainScrollView) {
        _mainScrollView = [[UIView alloc] init];
        _mainScrollView.backgroundColor = [UIColor redColor];
    }
    return _mainScrollView;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
